//
//  EngineMannager.h
//  BizLeader
//
//  Created by Draven on 2018/1/17.
//  Copyright © 2018年 biz. All rights reserved.
//

#import <JSONModel/JSONModel.h>
#import "BaseRequestParameter.h"
#import "APIRequestConstant.h"
#import "CoreEngine.h"

typedef void(^HttpRequestCompleteBlock)(id _Nullable retItem, NSError * _Nullable error);

@interface EngineMannager : BaseRequestParameter {
    HTTPSRequestType _requestType;
    HttpRequestCompleteBlock _completeBlock;
    Class _retClass;
}
// 只需要写 path即可
@property (nonatomic, copy) NSString<Ignore> * _Nullable path;
/*
 * normal request
 */
- (void)startRequestWithRetClass:(Class _Nullable )retClass
                andCompleteBlock:(HttpRequestCompleteBlock _Nullable )completeBlock;

@end

@protocol EngineMannagerError <NSObject>

@end

@interface  EngineMannagerError: JSONModel
@property (nonatomic, copy) NSString <Optional> * _Nullable key;
@property (nonatomic, copy) NSString <Optional> * _Nullable value;
@end

@interface EngineMannagerItem : JSONModel
@property (nonatomic, copy) NSString <Optional> * _Nullable code;
@property (nonatomic, copy) NSString <Optional> * _Nullable message;
@property (nonatomic, copy) NSString <Optional> * _Nullable type;
@property (nonatomic, strong) NSArray <Optional, EngineMannagerError> * _Nullable error;
@end

